import 'package:farmer_app/common/chat/avatar.dart';
import 'package:farmer_app/common/chat/mention.dart';
import 'package:farmer_app/common/chat/send_on_enter.dart';
import 'package:farmer_app/common/chat/theming.dart';
import 'package:farmer_app/common/chat/typing_users_sample.dart';
import 'package:flutter/material.dart';

import '../../../common/chat/basic.dart';
import '../../../common/chat/media.dart';
import '../../../common/chat/quick_replies_sample.dart';

class SingleChatPage extends StatefulWidget {
  const SingleChatPage({super.key});

  @override
  State<SingleChatPage> createState() => _SingleChatPageState();
}

class _SingleChatPageState extends State<SingleChatPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Dash Chat Demo'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            ElevatedButton(
              onPressed: () => push(Basic()),
              child: const Text('Basic'),
            ),
            ElevatedButton(
              onPressed: () => push(Media()),
              child: const Text('Chat media'),
            ),
            ElevatedButton(
              onPressed: () => push(AvatarSample()),
              child: const Text('All user possibilities'),
            ),
            ElevatedButton(
              onPressed: () => push(QuickRepliesSample()),
              child: const Text('Quick replies'),
            ),
            ElevatedButton(
              onPressed: () => push(TypingUsersSample()),
              child: const Text('Typing users'),
            ),
            ElevatedButton(
              onPressed: () => push(SendOnEnter()),
              child: const Text('Send on enter'),
            ),
            ElevatedButton(
              onPressed: () => push(MentionSample()),
              child: const Text('Mention'),
            ),
            ElevatedButton(
              onPressed: () => push(ThemeSample()),
              child: const Text('Theming'),
            ),
          ],
        ),
      ),
    );
  }

  void push(Widget page) {
    Navigator.of(context).push(
      MaterialPageRoute<String>(
        builder: (BuildContext context) {
          return page;
        },
      ),
    );
  }
}
